﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.IO;

namespace KPIS.GERP.GHRMS.APP.App_UI.Forms
{
    public partial class PS_EmployeesEdit : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                RadTabStrip1.SelectedIndex = 0;
                AddPageView(RadTabStrip1.SelectedTab);
                RadTabStrip1.SelectedTab.PageView.Selected = true;
            }
        }

        private void AddPageView(RadTab Tab)
        {
            RadPageView pageView = new RadPageView();
            pageView.ID = Tab.Value;

            RadMultiPage1.PageViews.Add(pageView);
            Tab.PageViewID = pageView.ID;
        }

        protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
        {
            AddPageView(e.Tab);
            e.Tab.PageView.Selected = true;
        }

        protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e)
        {
            string strUserControlName = "../UserControls/" + e.PageView.ID + ".ascx";

            Control userControl = Page.LoadControl(strUserControlName);
            userControl.ID = e.PageView.ID + "_userControl";

            e.PageView.Controls.Add(userControl);
        }
    }
}
